import { defineStore } from 'pinia'
import { reactive } from 'vue'
import { reqPatientList } from '@/api/patient'
import { Patient } from '@/api/patient/type'

const usePatientStore = defineStore('patient', () => {
  let patientList = reactive([] as Patient[])

  // 获取所有就诊人信息
  const initPatientList = async () => {
    const { data } = await reqPatientList()
    patientList = data
  }

  return {
    patientList,
    initPatientList
  }
})

export default usePatientStore